package Client;

import java.io.File;
import java.io.FileInputStream;
import java.security.KeyStore;
import java.util.Enumeration;

public class TextKey {

	public void TextKey() {
	}

	public static void main(String[] args) {
		try {
			// Load the keystore in the user's home directory
			File file = new File(System.getProperty("user.home")
					+ File.separatorChar + ".keystore");
			FileInputStream is = new FileInputStream(file);
			KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
			String password = "my-keystore-password";
			keystore.load(is, password.toCharArray());

			// List the aliases
			Enumeration<String> bajs = keystore.aliases();
			while (bajs.hasMoreElements()) {
				String alias = (String) bajs.nextElement();
				System.out.print(alias);
				// Does alias refer to a private key?
				boolean b = keystore.isKeyEntry(alias);

				// Does alias refer to a trusted certificate?
				b = keystore.isCertificateEntry(alias);
			}
			
			is.close();
		} catch (Exception e) {
			System.out.print("bajs");
		}
	}
}
